'use strict';
const Service = require('egg').Service;

class MeetingNoticeService extends Service {
  async start() {
    const { ctx } = this;
    const res = await ctx.curl('https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=7f29cdd0-1ef5-4a0b-a075-380f4d1ef4d0', {
      method: 'POST',
      data: {
        msgtype: 'text',
        text: {
          content: '开会啦🏃',
          mentioned_mobile_list: [ '@all' ],
        },
      },
      dataType: 'json',
      headers: {
        'Content-Type': 'application/json',
      },
    });
    return res.data;
  }
}

module.exports = MeetingNoticeService;
